/**
 *ZHU framework. Copyright 2007-, all rights reserved.
 *
 * $Id$
 * $Revision$
 * $Date$
 * $Author$
 */
package daily.entity.security;

import javax.persistence.*;
import javax.persistence.Entity;

import zhu.framework.entity.*;

/**
 * @author xiaopengzhu
 * 
 */
@Entity
@Table(name = "function_security_setting")
public class FunctionSecuritySetting extends AbstractEntityWithLongId implements Comparable<FunctionSecuritySetting> {

	/**
	 * @return the function
	 */
	public Function getFunction() {
		return function;
	}

	/**
	 * @param function
	 *            the function to set
	 */
	public void setFunction(final Function function) {
		this.function = function;
	}

	/**
	 * @return the securityRole
	 */
	public SecurityRole getSecurityRole() {
		return securityRole;
	}

	/**
	 * @param securityRole
	 *            the securityRole to set
	 */
	public void setSecurityRole(final SecurityRole securityRole) {
		this.securityRole = securityRole;
	}

	@Override
	public int compareTo(final FunctionSecuritySetting o) {
		return function.compareTo(o.getFunction());
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Enumerated(EnumType.STRING)
	private Function function;

	@Enumerated(EnumType.STRING)
	private SecurityRole securityRole;
}
